feat: Add HTTP response status code matching support#1790
Draft
feat: Add HTTP response status code matching support#1790
Conversation
2 tasks
Agent-Logs-Url: https://github.com/pact-foundation/pact-js/sessions/5ef516cc-a979-4b12-9ecf-06f58a7622be Co-authored-by: mefellows <53900+mefellows@users.noreply.github.com>
Since we have consolidated to vitest, the jest and mocha regression suites are actually not currently functional. If we want, we can create dedicated tests for these later, but deleting for now as I don't think they serve much benefit. Signed-off-by: JP-Ellis <josh@jpellis.me>
…, StatusCodeMatcher) Agent-Logs-Url: https://github.com/pact-foundation/pact-js/sessions/5ef516cc-a979-4b12-9ecf-06f58a7622be Co-authored-by: mefellows <53900+mefellows@users.noreply.github.com>
…straint to reify Agent-Logs-Url: https://github.com/pact-foundation/pact-js/sessions/5ef516cc-a979-4b12-9ecf-06f58a7622be Co-authored-by: mefellows <53900+mefellows@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for status code matching
feat: Add HTTP response status code matching support
May 6, 2026
Replace mocha with vitest for faster test running, and native TS support. Also reduce the number of dependencies by switching to vitest's own assertion library. Signed-off-by: JP-Ellis <josh@jpellis.me>
Signed-off-by: JP-Ellis <josh@jpellis.me>
Not sure why this wasn't covered in CI before Signed-off-by: JP-Ellis <josh@jpellis.me>
In particular, consolidate the x86 and ARM tests into one job now that we have ARM runners available. Signed-off-by: JP-Ellis <josh@jpellis.me>
Helps with cross-platform support, in case `bash` is not available or easily invoked (e.g., CI in Windows running in pwsh). Signed-off-by: JP-Ellis <josh@jpellis.me>
Signed-off-by: JP-Ellis <josh@jpellis.me>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: mefellows <53900+mefellows@users.noreply.github.com>
Agent-Logs-Url: https://github.com/pact-foundation/pact-js/sessions/5ef516cc-a979-4b12-9ecf-06f58a7622be Co-authored-by: mefellows <53900+mefellows@users.noreply.github.com>
…, StatusCodeMatcher) Agent-Logs-Url: https://github.com/pact-foundation/pact-js/sessions/5ef516cc-a979-4b12-9ecf-06f58a7622be Co-authored-by: mefellows <53900+mefellows@users.noreply.github.com>
…straint to reify Agent-Logs-Url: https://github.com/pact-foundation/pact-js/sessions/5ef516cc-a979-4b12-9ecf-06f58a7622be Co-authored-by: mefellows <53900+mefellows@users.noreply.github.com>
…st mocks Agent-Logs-Url: https://github.com/pact-foundation/pact-js/sessions/cdc8a69c-4c0e-4cf1-80ca-2b5539d03d16 Co-authored-by: mefellows <53900+mefellows@users.noreply.github.com>
…est test Co-authored-by: mefellows <53900+mefellows@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1790 +/- ##
=========================================
Coverage ? 60.87%
=========================================
Files ? 67
Lines ? 4187
Branches ? 354
=========================================
Hits ? 2549
Misses ? 1636
Partials ? 2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…seStatusClass, StatusCodeMatcher) Co-authored-by: mefellows <53900+mefellows@users.noreply.github.com>
…-support' into copilot/add-status-code-matching-support Co-authored-by: mefellows <53900+mefellows@users.noreply.github.com>
…ock.json to master Co-authored-by: mefellows <53900+mefellows@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
origin/mastersrc/v3/types.ts—StatusCodeMatcher<T>,HTTPResponseStatusClassenum,V3Response.statuswidenedsrc/v3/matchers.ts—matchStatus(),isStatusCodeMatcher(), genericreify<T>()src/common/matchingRules.ts—convertStatusMatcherToFFI()src/v3/ffi.ts— status matching rules emitted insetResponseDetailssrc/v4/http/types.ts— interface signatures updated to acceptnumber | StatusCodeMatcher<number>src/v4/http/interactionWithRequest.ts— implementation updatedsrc/v4/http/interactionWithPluginRequest.ts— implementation updatedsrc/v3/matchers.spec.ts—matchStatustests using Vitest assertionssrc/v4/http/interactionWithRequest.spec.ts— new Vitest test file withvi.fnmocksnpm run check:fix— clean